package com.huilian.iotbox.admin.wap.dao;

import com.github.pagehelper.PageInfo;
import com.huilian.iotbox.data.dto.CommodityDto;
import com.huilian.iotbox.data.po.Commodity;
import com.huilian.iotbox.data.vo.CommodityInfoCommonVo;
import com.huilian.iotbox.data.vo.CommodityVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CommodityDao {
    Integer insert(Commodity commodity);

    void insertTow(Commodity commodity);

    List<CommodityVo> findByStoreIdAndUserIdCommodity(CommodityDto commodityDto);

    CommodityVo queryById(Long id);

    Integer updatePackage(CommodityDto packageDto);

    int deletePackage(CommodityDto commodityDto);

    Integer findMaxPackageRecommend(CommodityDto commodityDto);
    Integer findMaxPackageRecommendByType(CommodityDto commodityDto);

    List<CommodityVo> findByStatus(CommodityDto commodityDto);

    List<CommodityVo> findMerchantStore(CommodityDto commodityDto);

    List<CommodityVo> findByGroup(CommodityDto commodityDto);

    Integer keepInsert(CommodityDto commodityDto);

    Integer updateCommodity(CommodityDto commodityDto);

    Commodity findOneCommodityByIdAndPermission(CommodityDto commodityCondition);

    List<Commodity> findAllCommodityByIdAndPermission(CommodityDto commodityDto);


    List<CommodityVo> findAllCommodity(CommodityDto commodityDto);

    CommodityVo findCommodityById(CommodityDto commodityDto);

    Integer updateVendingMachineCommodity(Commodity commodity);

    List<CommodityInfoCommonVo> findCommodityByBarCode(String barCode);

    /**
     * 根据条形码和userId查询商品信息
     */
    List<CommodityInfoCommonVo> findCommodityByBarCodeAndUserId(String barCode, Integer userId);

    List<CommodityVo> findCommodityList(CommodityDto commodityDto);

    Integer updateOffTheShelvesById(@Param("id") Long id, @Param("userId") Integer userId,@Param("deleteStatus") Boolean deleteStatus);

    List<CommodityVo> findSalesCommodityList(CommodityDto commodityDto);

    List<CommodityVo> findCommodityByRetailPriceList(CommodityDto commodityDto);

    List<CommodityVo> findCommodityByRetailPriceListByType(CommodityDto commodityDto);

    List<CommodityVo> findByStoreIdAndUserIdAndDeviceTypeIdCommodity(CommodityDto commodityDto);

    CommodityVo findOneCommodityByRetailPriceByParams(CommodityDto commodityDto);

    Integer findMaxPackageRecommendByParams(CommodityDto commodityDto);

    List<CommodityVo> findCommodityByStoreIdAndDeviceTypeIdCommodityList(CommodityDto commodityDto);
}
